<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>canvas进阶</title>
    <!-- 
        1. canvas 绘制图片
        2. canvas 绘制视频  扣背景
        3. canvas 轮播示例
           - 绘制图片背景
           - 绘制导航按钮
           - 绘制指示器圆点 
           - 事件处理-计算位置
     -->
</head>

<body>
    <canvas width="536" height="480"></canvas>
    <script>
        const loadImg = (src) => {
            new Promise((resolve, reject) => {
                const img = new Image()
                img.src = src
                img.onload = () => {
                    resolve(img)
                }
            })
        }
    </script>
</body>

</html>